package com.jy.unkown.AD;

import android.app.Activity;
import android.content.Intent;
import android.view.View;

import com.jy.common.BaseApplication;
import com.jy.unkown.UNKOWN;
import com.jy.unkown.entity.UnKownADType;
import com.jy.unkown.entity.UnkownSlotBean;
import com.jy.unkown.page.RewardActivity;
import com.jy.unkown.view.UnkownADView;
import com.jy.utils.utils.UI;

public class UnkwonReward extends BaseUnkownAd {
    @Override
    public UnkownSlotBean getUnkownSoltReqBean(UnkownSlotBean unkownSlotBean) {
        unkownSlotBean.slotheight = UI.px2dip(BaseApplication.getBaseApplication().getResources().getDisplayMetrics().heightPixels);
        unkownSlotBean.slotwidth = UI.px2dip(BaseApplication.getBaseApplication().getResources().getDisplayMetrics().widthPixels);
        return unkownSlotBean;
    }

    @Override
    int getAdType() {
        return UnKownADType.REWARD_VIDEO;
    }

    @Override
    public UnkownADView getADView(Activity activity) throws Exception {
        throw new Exception("不能调用此方法");
    }


    public void showAD(Activity activity) {
        Intent intent = new Intent(activity, RewardActivity.class);
        String key = Integer.toString(System.identityHashCode(unkownAdBean));
        UNKOWN.addAD(key, unkownAdBean);
        UNKOWN.addAdCallBack(key, adCallBack);
        intent.putExtra(UNKOWN.UNKOWN_AD_KEY, key);
        activity.startActivity(intent);
    }
}
